// pages/Happy school car/study.js
const app = getApp()
import Api from '../../utils/api.js'
// 另外的引用写法
import {baseUrl} from '../../utils/api.js'

// CMD规范
// const Api = require('../../utils/api.js');
// console.log(app)
Page({
  data: {
    title: "everybody",
    id:0
  },
  setTitle: function(event) {
    console.log(event)
    this.setData({
      title: "abc",
    })
  },
  onLoad(options) {

    console.log(options)
  },
  onShow: function() {
    console.log("onShow");
    console.log(this)
    let id = this.options.id ?this.options.id : "aaa";
    let name = this.options.name ?this.options.name : "sss";
    this.setData({
      id,
      name
    })
  },
  onReady: function() {
    wx.request({
      url: 'Api.shopcard',
      success:function(res){
        console.log(res)
      },
      fail:function(){
        console.log("请求失败")
      }
    })
    // console.log("onReady");
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },
  /**
 * 生命周期函数--监听页面加载
 */
  onLoad: function (options) {
      console.log(options)
  }
})
